In typical webpage protocols, a document object model (DOM) of a webpage structure may include a document, a body and several elements, including elements embedded within each other. Events, in particular user triggered events such as cursor movements, mouse clicks or keyboard events may be generated at various locations on the page. Application code running in the webpage environment may register event handlers on various web page objects. Web browsers may allow event handlers to handle events in a variety of ways. A first event handling method is referred to as event capturing. Event capturing provides an event first to the top most object in the web page hierarchical structure and onward in a descending fashion as follows:
DOCUMENT→BODY→ELEMENT A→ELEMENT B
Event bubbling provides an event first to the bottom most object and onward in an ascending fashion as follows:
ELEMENT B→ELEMENT A→BODY→DOCUMENT
An event listener will often stop propagation of an event, for example on a webpage where a “click” event on ELEMENT A does something different to a “click” on ELEMENT B.
In some cases, a second application, such as a JavaScript resource, may be added to the webpage. This second application may need to observe events that originate on the webpage. However, a problem may emerge if the first application uses and does not propagate various events.
What is required is an improved system, method and computer readable medium for providing event handling.